#!/bin/bash

BG='#e7e8eb'
FG='#2f343f'
fg_title='#3676e8'

font1="Input Mono Condensed:style=Bold:pixelsize=9"
icons2="FontAwesome:size=11"
icons4="FontAwesome:size=9"

while :; do
Cpu=$(usedcpu | gdbar -h 7 -w 70 -fg '#3676e8' -bg '#3676e8' -ss 1 -sw 3 -nonl -s o -max)
Ram=$(awk '/MemTotal/ {t=$2} /MemFree/ {f=$2} /^Cached/ {c=$2} END {print t-f-c " " t;}' /proc/meminfo | gdbar -h 7 -w 70 -fg '#3676e8' -bg '#3676e8' -ss 1 -sw 3 -nonl -s o -max)
Disk=$(df -h /media/1Tb | awk 'NR==2{gsub(/[[:punct:]]/,""); print $5}'  | gdbar -h 7 -w 70 -fg  '#3676e8' -bg  '#3676e8' -ss 1 -sw 3  -nonl -s o -max)
Thermal=$(cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_input | sed 's/.\{3\}$/°C/')
Thermal1=$(cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp3_input | sed 's/.\{3\}$/°C/')
Thermal2=$(cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp4_input | sed 's/.\{3\}$/°C/')
Thermal3=$(cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp5_input | sed 's/.\{3\}$/°C/')

echo " ^fn($font1)^p(_CENTER)^p(-110)^fg($fg_title)Hardware Information

  ^fn($font1) Ram  ^fn($font1) $Ram
  ^fn($font1) Cpu  ^fn($font1) $Cpu
  ^fn($font1) Disk ^fn($font1) $Disk

  ^fn($font1) Cpu-temp   ^fn($font1) $Thermal
  ^fn($font1) Cpu-temp   ^fn($font1) $Thermal1
  ^fn($font1) Cpu-temp   ^fn($font1) $Thermal2
  ^fn($font1) Cpu-temp   ^fn($font1) $Thermal3
"
sleep 1
done | dzen2 -p -x 245  -y 885 -w 140 -bg $BG -fg $FG -l 10 -sa l -ta c -e 'onstart=uncollapse;button1=exit;button3=exit' -fn 'Input Mono Condensed:style=Bold:pixelsize=10'
